package com.huawei.appgallery.assistantdock.buoydock.card.card;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.assistantdock.base.cardkit.bean.BuoyBaseCardBean;
import com.huawei.appgallery.assistantdock.base.cardkit.card.BuoyBaseCard;
import com.huawei.appgallery.assistantdock.buoydock.card.bean.BuoyAppDataItem;
import com.huawei.appgallery.foundation.service.common.protocol.AppDetailActivityProtocol;
import com.huawei.appgallery.foundation.service.common.protocol.AppDetailActivityProtocol.Request;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.widget.MaskImageView;
import o.beo$e;
import o.beq;
import o.cgz;
import o.chy;
import o.cjl;
import o.cjm;
import o.cjo;
import o.eqx;
import o.evx;
import o.fam;

public class BuoyAppItemCardBuoy extends BuoyBaseCard {
    public BuoyAppItemCardBuoy(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        ˏ((ImageView) view.findViewById(beo$e.ʼ));
        ॱ((TextView) view.findViewById(beo$e.ॱ));
        ˊ((TextView) view.findViewById(beo$e.ˏ));
        ʽ(view);
        ((MaskImageView) this.ʽॱ).setCornerType(2);
        ((MaskImageView) this.ʽॱ).ॱ(1);
        return this;
    }

    public void w_() {
        eqx.ˏ(this.ʽॱ, ((BaseCardBean) this.ˊᐝ).ॱˌ(), "app_default_icon");
    }

    public void ˎ(BaseCardBean baseCardBean) {
        super.ˎ(baseCardBean);
        if (baseCardBean instanceof BuoyBaseCardBean) {
            if (this.ˉ != null) {
                this.ˉ.setCompoundDrawables(null, null, null, null);
            }
            ˋ();
        }
    }

    private void ˋ() {
        ˊ();
    }

    private void ˊ() {
        this.ʿ.setMaxLines(2);
        ˋˊ().setMaxLines(1);
    }

    public void x_() {
        if (this.ˊᐝ instanceof BuoyAppDataItem) {
            this.ˉ.setText(((BuoyAppDataItem) this.ˊᐝ).ˊ());
        }
    }

    public void ॱ(chy o_chy) {
        OnClickListener anonymousClass2 = new evx(this) {
            final /* synthetic */ BuoyAppItemCardBuoy ˊ;

            {
                this.ˊ = r1;
            }

            public void ˋ(View view) {
                this.ˊ.ᐝ();
            }
        };
        ʼॱ().setOnClickListener(anonymousClass2);
        ˉ().setOnClickListener(anonymousClass2);
    }

    private void ᐝ() {
        if (this.ˊᐝ instanceof BuoyAppDataItem) {
            BuoyAppDataItem buoyAppDataItem = (BuoyAppDataItem) this.ˊᐝ;
            cjo appDetailActivityProtocol = new AppDetailActivityProtocol();
            Request request = new Request();
            request.ˋ(buoyAppDataItem.ॱॱ());
            appDetailActivityProtocol.ˏ(request);
            fam.ॱ().ॱ(this.ʼॱ, cjl.ˋ("appdetail.activity"), new cjm("appdetail.activity", appDetailActivityProtocol));
            beq.ˎ(buoyAppDataItem);
        }
    }
}
